package org.bigk.invoices.actions.info;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.SessionAware;
import org.bigk.invoices.Globals;
import org.bigk.invoices.actions.InvoicesActionSupport;
import org.bigk.invoices.model.User;

public class InfoAction extends InvoicesActionSupport implements SessionAware {
	/**
	 * Logger for this class
	 */
	private static final Log logger = LogFactory.getLog(InfoAction.class);

	private static final long serialVersionUID = 0x54e9c399503b9f5L;

	private User user;
	private Map<String, Object> session;

	public String execute() {
		if (logger.isDebugEnabled()) {
			logger.debug("execute() - start");
		}

		User user = (User) session.get(Globals.SP_USER);
		setUser(user);

		if (logger.isDebugEnabled()) {
			logger.debug("execute() - end - return value=" + SUCCESS);
		}
		return SUCCESS;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;

	}

}
